
package com.mengmeizi;

import com.mengmeizi.util.Const;
import com.umeng.analytics.MobclickAgent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class ActImageCache extends Activity implements OnClickListener {

    private SoftApplication application;

    private ImageView imvTitle;

    private TextView txvCachePath;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_imagecache);

        application = (SoftApplication) getApplication();

        application.addActivity(this);

        imvTitle = (ImageView) findViewById(R.id.imvTitle);
        imvTitle.setOnClickListener(this);

        txvCachePath = (TextView) findViewById(R.id.txvCachePath);
        txvCachePath.setText(Const.FILENAME_IMGCACHE);
    }

    @Override
    public void onClick(View v) {
        if (v instanceof ImageView) {
            if (v == imvTitle) {
                Intent intent = new Intent(this, ActMore.class);
                startActivity(intent);
                this.finish();
            }
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            Intent intent = new Intent(this, ActMore.class);
            startActivity(intent);
            this.finish();
        }
        return super.onKeyDown(keyCode, event);
    }

    public void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);
    }

    public void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }
}
